package com.ymatou.iapi.productlist.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;


public class GetProductListByLiveIdCall extends YmatouBaseCall{
	private static String opurl ="/api/Product/GetProductListByLiveId";
	
	public GetProductListByLiveIdCall() {
		super(EnvSetup.getSystemUrl("productlist"),opurl,"GET","PARAMETER");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	

	public static JSONObject GetProductListByLiveId(int liveId) throws Exception{
		GetProductListByLiveIdCall getProductListByLiveIdCall=new GetProductListByLiveIdCall();
		getProductListByLiveIdCall.setData("LiveId=" + liveId);
		getProductListByLiveIdCall.callService();
		return  new JSONObject(getProductListByLiveIdCall.getReturnData()) ;
	}
	
	public static void main(String[] args) throws Exception {
		GetProductListByLiveId(151957);
	}
	

}
